//
//  CXUserProtocolVC.m
//  GongJiJin
//
//  Created by 凯朱 on 2022/4/6.
//

#import "SLSupportVC.h"

@interface SLSupportVC ()<WKNavigationDelegate,WKUIDelegate>{
    
}
@property (nonatomic, strong)WKWebView *webView;
@end

@implementation SLSupportVC

- (void)viewDidLoad {
    [super viewDidLoad];
    _webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, SafeAreaTopHeight, KScreenWidth, KScreenHeight-SafeAreaTopHeight)];
    [self.view addSubview:_webView];
    _webView.navigationDelegate = self;
    self.title = kLocalString(@"Support");
    NSString *content = @"<p>产品说明书<br>说明书内容待更新</p >";
    [self.webView loadHTMLString:content baseURL:nil];
//    [self loadData];
}

-(void)loadData{
    kWeakSelf(self);
    [ZCTool showLoadingOnKeyWindow];
    [ZKHttpManager getWithPath:@"/msl_user/getDocumentList" params:nil finished:^(BOOL isSuccessed, id  _Nonnull result, NSString * _Nonnull code, NSString * _Nonnull message) {
        [ZCTool hideLoadingOnKeyWindow];
        if (!isSuccessed) {
            kShowToast(message);
            return;
        }
        NSString *content = @"<p>产品说明书<br>说明书内容待更新</p >";
        [weakself.webView loadHTMLString:content baseURL:nil];
    }];
}

// WKNavigationDelegate 页面加载完成之后调用
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
//    修改字体大小 300%
    [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '200%'"completionHandler:nil];
    //修改字体颜色  #9098b8
    [ webView evaluateJavaScript:@"document.getElementsByTagName('body')[0].style.webkitTextFillColor= '#111111'"completionHandler:nil];
}
@end
